New research reveals how the simple nervous system of C. elegans worms can dramatically reconfigure itself to survive infection. When exposed to harmful bacteria, the worms adapted by rewiring the roles of key neurons and neuromodulators to reduce feeding and resist quiescence.